﻿using System;
using System.Collections.Generic;
using IDAL;
using Model;
using Model.RF.QuantityInfo;

namespace BLL
{
    public class Airtightness : BaseService<AirtightnessInfo>
    {
        private static readonly IAirtightness dal = DALFactory.DataAccess.CreateAirtightness();

        public override void SetCurrentRepository()
        {
            CurrentRepository = dal;
        }

        public IList<AirtightnessInfo> Airtightness_SelectbySN(string productSN)
        {
            return dal.Airtightness_SelectbySN(productSN);
        }

        public IList<AirtightnessInfo> Airtightness_SelectbyDT(DateTime startTime, DateTime stopTime)
        {
            return dal.Airtightness_SelectbyDT(startTime, stopTime);
        }

        public IList<AirtightnessInfo> Airtightness_SelectbyPIDDT(string productTypeID, DateTime startTime, DateTime stopTime)
        {
            return dal.Airtightness_SelectbyPIDDT(productTypeID, startTime, stopTime);
        }

        public IList<ProductType_QInfo> Airtightness_GetQbyPIDDT(DateTime startTime, DateTime stopTime)
        {
            return dal.Airtightness_GetQbyPIDDT(startTime, stopTime);
        }

        public IList<Department_PRInfo> Airtightness_GetPRbyIPDT(DateTime startTime, DateTime stopTime,string opr_or_pr)
        {
            switch (opr_or_pr)
            {
                case "OPR":
                    return dal.Airtightness_GetOPRbyIPDT(startTime, stopTime);
                case "PR":
                    return dal.Airtightness_GetPRbyIPDT(startTime, stopTime);
                default:
                    return null;
            }
        }
    }
}
